//VARS
int numInputs = 6;

int analogInputValue[6] = {0,0,0,0,0,0};

int n;

//SERIAL INTEGER TO BYTE
                // 0   1   2   3   4   5   6   7
int binOut [] = {000,                1, 10, 11,100,101,110,111};
               // 4   6   2   1   7   5   0   3
int binIn [] =  {100,110, 10,  1,111,101,000, 11};
char inByte = 'B';
byte msB, lsB;
int serialInCount = 0;


void setup() {
  // open the serial port at 9600 bps:
  Serial.begin(9600);
}

void loop() {

  // read the value on analog input
  if (Serial.available() > 0) {
    inByte = Serial.read();

    if (inByte == 'A') {  
      
    for (n = 0;n<numInputs;n++) {
        analogInputValue[n] = analogRead(n);
        delay(1);
      }
      
      for (n = 0;n<numInputs;n++) {
        msB = byte((analogInputValue[n] & 65280) >> 8);                     // 65280 = 0b1111111100000000
        lsB = byte(analogInputValue[n] & 255);                              // 255 =   0b0000000011111111
        Serial.print(msB,BYTE);
        Serial.print(lsB,BYTE);        
      }

     }
  }
}
